<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">品牌管理</h4>
    <button ui-sref="app.brand" class="btn-back btn btn-dark btn-sm btn-rounded">
        返回
    </button>
</div>
<div class="wrapper-md">
    <div class="panel panel-default" ng-controller="addBrandCtrl">
        <div class="panel-heading m-n">
            添加品牌信息
        </div>
        <div class="panel-body">
            <form name="brandForm" class="form-horizontal ng-pristine ng-valid ng-valid-date ng-valid-required ng-valid-parse ng-valid-date-disabled"
                  method="post" ng-submit="addBrand()">
                <div class="form-group">
                    <label class="col-sm-2 control-label">品牌名称</label>
                    <div class="col-sm-5">
                        <input type="text" name="name" ng-model="brand.name" class="form-control" placeholder="请输入品牌名称" required>
                    </div>
                    <div class="col-sm-5 form-text" ng-if="brandForm.name.$touched">
                        <span class="text text-danger" ng-if="brandForm.name.$error.required">品牌名称是必填的</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">品牌介绍</label>
                    <div class="col-sm-5">
                        <textarea class="form-control" name="description" ng-model="brand.description" rows="5" placeholder="请输入品牌介绍"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">品牌LOGO图片</label>
                    <div class="col-sm-5">
                        <div class="panel-body fa-border bg-light inline" ng-controller="fileUploadCtrl"  nv-file-drop="" uploader="uploader" filters="picFilter" ng-init="queueLimit=1">
                            <div>
                                <div class="pu-item-con" ng-repeat="item in uploader.queue">
                                    <div class="pu-item">
                                        <div class="pu-pic">
                                            <span class="fa fa-plus pu-fa" ng-if="!item.isSuccess"></span>
                                            <img ng-src="{{item.imgsrc}}" err-src="img/error.png" class="pu-picture-pre-view" ng-if="item.isSuccess"/>
                                        </div>
                                        <div class="block m-b-sm">
                                            <div ng-if="item.isSuccess">
                                                <div class="btn btn-sm btn-block btn-danger" ng-click="del(item)">图片移除</div>
                                            </div>
                                        </div>
                                        <div class="pu-process m-b-n">
                                            <div class="progress bg-light m-b-n">
                                                <div class="progress-bar progress-bar-striped active" ng-class="{true:'bg-danger',false:'bg-success'}[item.isError]" ng-bind="{true:'上传失败',false:item.progress+'%'}[item.isError]" role="progressbar" ng-style="{ 'width': item.progress + '%' }" style="width: 100%;">{{item.progress}}%</div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="pu-item-con" ng-if="(queueLimit>uploader.queue.length)">
                                    <div class="pu-item w-md">
                                        <div class="pu-pic">
                                            <span class="fa fa-plus pu-fa"></span>
                                        </div>
                                        <span>{{item.file.name}}</span>
                                        <div class="block">
                                            <div class="pos-rlt" ng-if="!isSuccess">
                                                <button class="btn btn-sm btn-block btn-info">点击选择图片</button>
                                                <input type="file" ng-model="file" class="pu-file" nv-file-select="" multiple uploader="uploader" accept="image/gif,image/jpeg,image/jpg,image/png" required>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="submit" class="btn btn-success">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>




